/**
 * 
 */
package com.snl.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


/**
 * @author Bryan Liu
 *
 */
@Entity
@Table(name="PARTY_USER")
@IdClass(UserPartyId.class)
public class UserPartyLink {
	
	@Id
	private int userId;
	
	@Id
	private int partyId;
	
	@Column(name="ADDITIONAL_GUEST")
	private int additionalGuest;
	
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="PARTY_ID",nullable=false, updatable=false, insertable=false)
	private Party party;
	
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="USER_ID", nullable=false, updatable=false, insertable=false)
	private User user;
	
	
	
	
	/**
	 * @return the userId
	 */
	public int getUserId() {
		return userId;
	}

	/**
	 * @param userId the userId to set
	 */
	public void setUserId(int userId) {
		this.userId = userId;
	}

	/**
	 * @return the partyId
	 */
	public int getPartyId() {
		return partyId;
	}

	/**
	 * @param partyId the partyId to set
	 */
	public void setPartyId(int partyId) {
		this.partyId = partyId;
	}

	/**
	 * @return the additionalGuest
	 */
	public int getAdditionalGuest() {
		return additionalGuest;
	}

	/**
	 * @param additionalGuest the additionalGuest to set
	 */
	public void setAdditionalGuest(int additionalGuest) {
		this.additionalGuest = additionalGuest;
	}

	/**
	 * @return the party
	 */
	public Party getParty() {
		return party;
	}

	/**
	 * @param party the party to set
	 */
	public void setParty(Party party) {
		this.party = party;
	}

	/**
	 * @return the user
	 */
	public User getUser() {
		return user;
	}

	/**
	 * @param user the user to set
	 */
	public void setUser(User user) {
		this.user = user;
	}
	

}
